package sanshi.contect.observer.v3;

public class Child {

    Dad dad = new Dad();

    public boolean cry = false;

    public boolean isCry(){
        return cry;
    }

    public void wakeUp(){
        cry = true;
        dad.feed();
    }

}

/**
 * 这个就是一个观察者
 */
class Dad{
    public void feed(){
        System.out.println("bad is feeding.....");
    }
}
class Main{
    public static void main(String[] args) {
        Child child = new Child();
        child.wakeUp();
    }
}
